<template>
  <div class="home">
    <el-container>
      <el-header>Vue+ElementUi+Servlet+Mybatis+Maven</el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
                  default-active="2"
                  background-color="#545c64"
                  class="el-menu-vertical-demo"
                  router
                  :default-active="$route.path"
                  text-color="#fff"
                  active-text-color="#ffd84b">
            <span class="xiaoyuan">小缘开发平台</span>
            <el-submenu :index="menu.path" v-for="menu in menus">
              <template slot="title">
                <i :class="menu.icon"></i>
                <span>{{menu.title}}</span>
              </template>

              <el-menu-item :index="menu.path+child.path" v-for="child in menu.children">
                <i :class="child.icon"></i>
                <span>{{child.title}}</span>
              </el-menu-item>
            </el-submenu>

          </el-menu>
        </el-aside>
        <el-main>
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import menus from "../assets/menu";
export default {
  name:'Home',
  data(){
    return {
      menus:menus
    }
  },
  created(){

  },
  methods:{

  },
  components:{

  }
}
</script>

<style>
  *{
    margin: 0;
    padding: 0;
  }
  .xiaoyuan{
    color: white;
    font: 25px 华文行楷;
  }
  .el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }

  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 10px;
  }

  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 20px;
  }

  body > .el-container {
    margin-bottom: 40px;
  }

  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }

  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>